package com.changgou.order.feign;

import com.changgou.order.pojo.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import com.changgou.entity.Result;
import java.util.Map;

/**
 * @Author LQQ
 * @Date 2020/3/11 19:20
 * @Version 1.0
 */

@FeignClient(name = "order")//声明它是一个feign的功能接口,name=被调用服务的名字
public interface OrderFeign {

    @GetMapping("/cart/addCart")
    public Result addCart(@RequestParam("skuId") String skuId, @RequestParam("num") Integer num);

    @GetMapping("/cart/list")
    public Map list();

    @PostMapping("/order")
    public Result add(@RequestBody Order order);

    @GetMapping("/order/{id}")
    public Result<Order> findById(@PathVariable("id") String id);
}
